package com.example.demo.test;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author Jensen Zhan
 */
@Service
public class ThreadService {

    @Async
    public void sendMessage1() {
        for (int i = 0; i < 10000; i++) {
            Thread thread = Thread.currentThread();
            System.out.println(thread.getName());
        }
    }

    @Async
    public void sendMessage2() {
        for (int i = 0; i < 10000; i++) {
            Thread thread = Thread.currentThread();
            System.out.println(thread.getName());
        }
    }
}
